package com.xiangge.db.pojo;

import com.xiangge.db.converter.StringListConverter;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author lsy_server
 */
@Entity
@Table(name = "synthesize_goods")
@Data
public class SynthesizeGoods {
    @Id
    private Long id;
    private String title;
    private String detail;
    private Integer saleNum;
    @Convert(converter = StringListConverter.class)
    private List<String> pics;
    @Enumerated(EnumType.STRING)
    private GoodsSourceEnum source;
    private String visitUrl;
    private BigDecimal price;
    private BigDecimal vipPrice;
    private Integer categoryId;

    public enum GoodsSourceEnum {
        TIANMAO("TIANMAO", "天猫"),
        JINGDONG("JINGDONG", "京东"),
        TAOBAO("TAOBAO", "淘宝");
        private String name;
        private String desc;

        GoodsSourceEnum(String name, String desc) {
            this.name = name;
            this.desc = desc;
        }

    }
}
